1. Field of the Invention
The invention relates to a data transmission method and a universal serial bus (USB) host controller using the data transmission method, and more particularly to a method of performing data transmission between a USB device and a host, wherein a USB host controller performs the method.
2. Description of the Related Art
For the current universal serial bus (USB) 3.0 protocol specification, a host exchanges data with USB device through a host controller. In order to support a dual-bus USB 3.0 structure, the host controller is required to include Super-Speed USB 3.0 elements and USB 2.0 elements, so the exchanging of control, states, and data on each bus between the host and the USB device can be managed simultaneously. The host controller includes several downstream ports for Super-Speed USB 3.0 and USB 2.0. Through these downstream ports, the host can examine connection and removal states of the USB devices, manage flow control between the host and the USB devices, manage data flow between the host and the USB devices, collect state and activity statistics, and supply power to the USB devices. Due to the Super-Speed USB 3.0 elements, USB 3.0 can provide a higher transmission speed which is nearly equal to decuple of the transmission speed of USB 2.0 and higher power saving efficiency. Thus, USB 3.0 can be widely applied in peripheral devices of computers and consumer electronic products.
In support of the USB 3.0 protocol, Intel issues Extensible Host Controller Interface (xHCI) protocol which mainly describes registers and data structures between system software and hardware for providing a standard communication manner between a USB 3.0 host controller and USB 3.0 peripheral driving programs. According to xHCI protocol and USB 3.0 protocol, a USB host controller can start or stop data transmission, for example, when buffer space configured for data transmission is run out of, the USB host controller stops the data transmission and notifies a USB device of the situation, then the USB device is switched to perform another data transmission or waits to perform the same data transmission after the USB host controller allocates buffer space.
In an upstream cycle/input transmission process, after a buffer in a current USB host controller receives enough input data from a USB device, the conventional USB host controller can calculate a cyclic redundancy check (CRC) result by using all input data and then combine the calculated CRC result with the all input data used for the CRC result calculation to form a data packet. Thus, when the buffer in the USB host controller receives the input data from the USB device, a bus of the USB host controller configured for transmitting data to a host is idle, resulting in lower usage rate of the bus and lower entire speed of data transmission. Moreover, the data stored in the buffer can not be transmitted to a system memory of the host immediately. Thus, when an upstream cycle/input transmission fails or is malfunctioned, if the USB device continuously transmits input data to the buffer in the USB host controller, buffer overrun of the USB host controller is easily induced.